<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>营业网点查询</title>
</head>
<body>
    <h1>编辑网点信息</h1>
    <form action="${action}" method="post">
        <c:if test="${branches != null}">
        <p>
            编号:
            <input readonly name="id" value="${branches.id}"/>
        </p>

        </c:if>
        <p>
            网点名称:<input name="name" value="${branches.name}"/>
        </p>
        <p>
            所在城区:
            <select name="cityAreaId">
                <c:forEach items="${areas}" var="item">
                    <c:choose>
                        <c:when test="${item.id==branches.cityAreaId}">
                            <option value="${item.id}" selected>${item.name}</option>
                        </c:when>
                        <c:otherwise>
                            <option value="${item.id}">${item.name}</option>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
            </select>
        </p>
        <p>
            网点地址:<input name="address" value="${branches.address}"/>
        </p>
        <p>
            联系电话:<input name="telephone" value="${branches.telephone}"/>
        </p>
        <p>
            <c:choose>
                <c:when test="${branches == null}">
                    <input value="新增" type="submit"/>
                </c:when>
                <c:otherwise>
                    <input value="修改" type="submit"/>
                </c:otherwise>
            </c:choose>

            <input type="reset"/>
        </p>
    </form>
</body>
</html>
